package com.edu.controller.dao.entity.bean.mapper;

import com.edu.controller.dao.entity.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserMapper {
    @Select("SELECT * FROM USER WHERE id = #{id}")
    User findByName(@Param("id") String id);
    @Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})")
    int insert(@Param("name") String name, @Param("age") Integer age);
    @Select("select * from user")
    List<User> getAll();

}